import 'package:get/get.dart';

class HomeController extends GetxController {
  // 当前选中的菜单索引
  final _currentIndex = 0.obs;
  get currentIndex => _currentIndex.value;
  set currentIndex(value) => _currentIndex.value = value;

  // 底部菜单项
  final List<Map<String, dynamic>> menuItems = [
    {'title': '首页', 'icon': 'assets/icons/home.png'},
    {'title': '报告查询', 'icon': 'assets/icons/report.png'},
    {'title': '费用查询', 'icon': 'assets/icons/cost.png'},
    {'title': '健康宣教', 'icon': 'assets/icons/education.png'},
    {'title': '医院信息', 'icon': 'assets/icons/hospital.png'},
    {'title': '医护列表', 'icon': 'assets/icons/staff.png'},
    {'title': '消息提醒', 'icon': 'assets/icons/message.png'},
    {'title': '服务评价', 'icon': 'assets/icons/evaluation.png'},
  ];

  // 切换菜单
  void changeTab(int index) {
    currentIndex = index;
  }

  // 护理按钮点击
  void onNursingPressed() {
    Get.toNamed('/nursing');
  }

  // 熄屏按钮点击
  void onScreenOffPressed() {
    // 实现熄屏逻辑
    Get.snackbar('提示', '熄屏功能已触发');
  }

  @override
  void onInit() {
    super.onInit();
  }

  @override
  void onReady() {
    super.onReady();
  }

  @override
  void onClose() {
    super.onClose();
  }
}